package com.it.goods.feign;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.it.goods.pojo.Sku;

import entity.Result;

@FeignClient(name="goods")
@RequestMapping(value = "/sku")
public interface SkuFeign {
   
    @GetMapping("/status/{status}")
    Result<List<Sku>> findByStatus(@PathVariable(value = "status") String status);

  //功能：根据skuID查询SKU信息
    @GetMapping(value = "/{id}")
    public Result<Sku> findById(@PathVariable(value = "id", required = true) Long id);
   
  //库存递减
    @PostMapping(value = "/dec/count")
    Result decCount(@RequestParam(value = "username") String username);

}
